package com.czd.support.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.czd.base.model.Paginate;
import com.czd.base.service.BaseService;
import com.czd.support.common.Configuration;
import com.czd.support.model.Navigate;

 
/**
 * @Description  企业信息导航
 * @Author JinMa.Xiao
 * @Date    2015年6月18日 下午4:57:55
 * @Version v1.0
 */
@Service
public class NavigateService extends BaseService<Navigate> {

	public Paginate queryForPaginate(Navigate navigate) {
		navigate.setPageSize(Configuration.getInstance().getDefault_page_size());
		return this.queryForPaginate(sqlId("queryForPaginate"), navigate);
	}

	public boolean insert(Navigate navigate) {
		return this.insert(sqlId("insert"), navigate);
	}

	public boolean del(int id) {
		return this.update(sqlId("del"), id);
	}

	public Navigate findById(int id) {
		return this.selectOne(sqlId("findById"), id);
	}

	public boolean update(Navigate navigate) {
		return this.update(sqlId("update"), navigate);
	}

	public List<Navigate> findByCompanyId(int companyId){
		return this.selectList(sqlId("findByCompanyId"), companyId);
	}
	
	public Navigate findByComNav(int id,int companyId){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", id);
		map.put("companyId", companyId);
		return this.selectOne(sqlId("findByComNav"), map);
	}
}
